import { ProFormText } from '@ant-design/pro-form';

export default (props: { isPersonal: boolean; isAdd: boolean }) => {
  const { isPersonal, isAdd } = props;

  return (
    <>
      {isAdd && !isPersonal && (
        <ProFormText
          name="username"
          label="账号"
          rules={[{ required: true, message: '请填写账号' }]}
        />
      )}
      <ProFormText name="first_name" label="姓" rules={[{ required: true, message: '请填写姓' }]} />
      <ProFormText name="last_name" label="名" rules={[{ required: true, message: '请填写名' }]} />
      <ProFormText
        name="email"
        label="邮箱"
        rules={[
          { required: true, message: '请填写邮箱' },
          { type: 'email', message: '请填写正确的邮箱' },
        ]}
      />
    </>
  );
};
